/*
 * Copyright @ 苏州瑞云信息技术有限公司 All rights reserved.
 */
package work.uuid;

import cn.hutool.core.util.IdUtil;

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

/**
 * @author Sakura Shen
 * <p>
 * 生产UUID
 * java.util.UUID的使用
 * @date 2021/6/30
 */
public class CreateUUId {
    public static void main(String[] args) {
        CreateUUId createUUId = new CreateUUId();
        createUUId.snowflake();
    }

    public void uuId() {
        for (int k = 0; k < 30; k++) {
            String uuid = UUID.randomUUID().toString();
            System.out.println(uuid);
        }
    }

    public void snowflake() {
        for (int k = 0; k < 10; k++) {
            long id = IdUtil.getSnowflakeNextId();
            System.out.println(id);
        }
    }
}
